# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
  # エラーメッセージを日本語化する
  def ja_error_messages_for(*params)
    result = error_messages_for(*params)
    result.sub!(/<h2>(\d+).*<\/h2>/) do
      "<h3>入力項目に#{$1}つのエラーがあります</h3>"
    end
    result.sub!(/<p>.*<\/p>/,"")
  end
end
